<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width"/>
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>作品地带</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/main.css" />
    <link rel="stylesheet" type="text/css" href="../../css/myProduct.css" />
</head>
<body id="productBody">
  <div id="header">
    <div id="back"></div>
    <h3>审核版主</h3>
  </div>
  <div id="all" style="padding-bottom:58px;">
    <div class="notice_list">
    </div>
  </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/jquery.js"></script>
<script type="text/javascript">
var aid="";
function getNotice_list(){
  var url='/api/moderator-applies/disposeList';
  var functionRet=function(ret){
    for (var i = 0; i < ret.length; i++) {
          var publicName=ret[i].value.moderatorType;
          var flag="";
          if(publicName==0){
            flag='php';
          }
          if(publicName==1){
            flag='java';
          }
          if(publicName==2){
            flag='javascript';
          }
          if(publicName==3){
            flag='c语言';
          }
          if(publicName==4){
            flag='云计算';
          }
          if(publicName==5){
            flag='大数据-hadoop技术';
          }
          if(publicName==6){
            flag='移动应用';
          }
          $(".notice_list").prepend('<div class="list" id='+ret[i].value.id+'><div class="notice_content"><span>'+ret[i].admin.nickname+'</span><span>版块：'+flag+'</span></div><div class="notice_time">申请时间：'+timestampToTime(ret[i].admin.time)+'</div><button class="btn btn-o">通过</button><button class="btn btn-defalut">拒绝</button></div>');
    }
  }
  var functionErr=function(err){
    return false;
  }
  get(url,functionRet,functionErr);
}
apiready=function(){
  getNotice_list();
  aid=$api.getStorage("aid");
}
//jquery
$(function(){
  back();
  //通过
  $("#all").on("click",".list .btn-o",function(){
    var url='/api/moderator-applies/'+$(this).closest(".list").attr("id")+'/status?disposeAid='+aid+'&status=2';
    var data=[];
    var functionRet=function(ret){
      toast("已通过","middle");
      api.execScript({
          script: history.go(0)
      });
    }
    var functionErr=function(err){
    }
    put(url,data,functionRet,functionErr)
  })
  //不通过
  $("#all").on("click",".list .btn-defalut",function(){
    var url='/api/moderator-applies/'+$(this).closest(".list").attr("id")+'/status?disposeAid='+aid+'&status=3';
    var data=[];
    var functionRet=function(ret){
      toast("已拒绝","middle");
      api.execScript({
          script: history.go(0)
      });
    }
    var functionErr=function(err){
    }
    put(url,data,functionRet,functionErr)
  })
})
</script>
<script type="text/javascript" src="../../script/main.js"></script>
</html>
